<%@ page language="java" contentType="text/html; charset=utf-8" %>
<%@ page import="com.alibaba.fastjson.JSONObject" %>
<%@ page import="weaver.conn.RecordSet" %>
<%@ page import="weaver.general.Util" %>
<%@ page import="java.util.HashMap" %>
<%@ page import="java.util.List" %>
<%@ page import="java.util.Map" %>
<%@ page import="java.util.ArrayList" %>
<jsp:useBean id="rs" class="weaver.conn.RecordSet" scope="page"/>
<jsp:useBean id="bb" class="weaver.general.BaseBean"/>
<%
    JSONObject jsonData = new JSONObject();
    List<Map<String, String>> mapList = new ArrayList<>();
    String ids = Util.null2String( request.getParameter( "ids" ) );//ids
    rs.executeQuery("select gys,twnr from uf_SRM_GYSTW where id in ("+ids+")");
    while (rs.next()){
        Map<String, String> dataMap = new HashMap<>();
        String gys =Util.null2String(rs.getString("gys"));
        String gysname = getGysName( gys );
        String twnr =Util.null2String(rs.getString("twnr"));
        dataMap.put("gys",gys);
        dataMap.put("gysname",gysname);
        dataMap.put("twnr",twnr);
        mapList.add( dataMap );
    }
    jsonData.put("dataList",mapList);
    out.print( jsonData.toJSONString() );
    bb.writeLog( "getSupplierIssuesData_Ajax=" + jsonData.toJSONString() );
%>
<%!
    //获取供应商名称
    public static String getGysName(String id) {
        RecordSet rs = new RecordSet();
        String gysmc = "";
        rs.executeQuery( "select gysmc from uf_srm_gyskpx where id=?", id );
        if (rs.next()) {
            gysmc = Util.null2String( rs.getString( "gysmc" ) );
        }
        return gysmc;
    }

%>

